In Bayesian probability theory, if, given a likelihood function
, the posterior distribution is in the same probability distribution family as the prior probability distribution , the prior and posterior are then called conjugate distributions with respect to that likelihood function and the prior is called a conjugate prior for the likelihood function .
A conjugate prior is an algebraic convenience, giving a closed-form expression for the posterior; otherwise, numerical integration may be necessary. Further, conjugate priors may clarify how a likelihood function updates a prior distribution.
The concept, as well as the term "conjugate prior", were introduced by Howard Raiffa and Robert Schlaifer in their work on Bayesian decision theory.[Howard Raiffa and Robert Schlaifer. Applied Statistical Decision Theory. Division of Research, Graduate School of Business Administration, Harvard University, 1961.] A similar concept had been discovered independently by George Alfred Barnard.[Jeff Miller et al. Earliest Known Uses of Some of the Words of Mathematics, "conjugate prior distributions". Electronic document, revision of November 13, 2005, retrieved December 2, 2005.]
Example
The form of the conjugate prior can generally be determined by inspection of the probability density or probability mass function of a distribution. For example, consider a
random variable which consists of the number of successes
in
with
unknown probability of success
in 0,1. This random variable will follow the binomial distribution, with a probability mass function of the form
The usual conjugate prior is the beta distribution with parameters (, ):
where
and
are chosen to reflect any existing belief or information (
and
would give a uniform distribution) and
is the
Beta function acting as a normalising constant.
In this context, and are called hyperparameters (parameters of the prior), to distinguish them from parameters of the underlying model (here ). A typical characteristic of conjugate priors is that the dimensionality of the hyperparameters is one greater than that of the parameters of the original distribution. If all parameters are scalar values, then there will be one more hyperparameter than parameter; but this also applies to vector-valued and matrix-valued parameters. (See the general article on the exponential family, and also consider the Wishart distribution, conjugate prior of the covariance matrix of a multivariate normal distribution, for an example where a large dimensionality is involved.)
If we sample this random variable and get successes and failures, then we have
P(s, f \mid q=x) &= {s+f \choose s} x^s(1-x)^f,\\
P(q=x) &= {x^{\alpha-1}(1-x)^{\beta-1} \over \Beta(\alpha,\beta)},\\
P(q=x \mid s,f) &= \frac{P(s, f \mid x)P(x)}{\int P(s, f \mid y)P(y)dy}\\
& = {0!} \approx 0.93
This is the Poisson distribution that is the most likely to have generated the observed data . But the data could also have come from another Poisson distribution, e.g., one with , or , etc. In fact, there is an infinite number of Poisson distributions that could have generated the observed data. With relatively few data points, we should be quite uncertain about which exact Poisson distribution generated this data. Intuitively we should instead take a weighted average of the probability of for each of those Poisson distributions, weighted by how likely they each are, given the data we've observed .
Generally, this quantity is known as the posterior predictive distribution where is a new data point, is the observed data and are the parameters of the model. Using Bayes' theorem we can expand therefore Generally, this integral is hard to compute. However, if you choose a conjugate prior distribution , a closed-form expression can be derived. This is the posterior predictive column in the tables below.
Returning to our example, if we pick the Gamma distribution as our prior distribution over the rate of the Poisson distributions, then the posterior predictive is the negative binomial distribution, as can be seen from the table below. The Gamma distribution is parameterized by two hyperparameters , which we have to choose. By looking at plots of the gamma distribution, we pick , which seems to be a reasonable prior for the average number of cars. The choice of prior hyperparameters is inherently subjective and based on prior knowledge.
Given the prior hyperparameters and we can compute the posterior hyperparameters and
Given the posterior hyperparameters, we can finally compute the posterior predictive of
This much more conservative estimate reflects the uncertainty in the model parameters, which the posterior predictive takes into account.
Table of conjugate distributions
Let
n denote the number of observations. In all cases below, the data is assumed to consist of
n points
(which will be
in the multivariate cases).
If the likelihood function belongs to the exponential family, then a conjugate prior exists, often also in the exponential family; see .
When the likelihood function is a discrete distribution
|
| successes, failures | (Bernoulli) |
| successes, failures | \operatorname{BetaBin}(\tilde{x}>\alpha',\beta') (beta-binomial) |
| total successes, failures (i.e., experiments, assuming stays fixed) | \operatorname{BetaNegBin}(\tilde{x}>\alpha',\beta')
(beta-negative binomial) |
Poisson | λ (rate) | Gamma | | total occurrences in intervals | (negative binomial) |
| total occurrences in intervals | (negative binomial) |
where is the number of observations in category i | occurrences of category | (Dirichlet-multinomial)
|
| successes, failures | |
| experiments, total failures | |
When likelihood function is a continuous distribution
|
| mean was estimated from observations with total precision (sum of all individual precisions) and with sample mean | \mathcal{N}(\tilde{x}>\mu_0', {\sigma_0^2}' +\sigma^2) |
| mean was estimated from observations with total precision (sum of all individual precisions) and with sample mean | |
| variance was estimated from observations with sample variance (i.e. with sum of squared deviations , where deviations are from known mean ) | t_{2\alpha'}(\tilde{x}>\mu,\sigma^2 = \beta'/\alpha') |
| variance was estimated from observations with sample variance | t_{\nu'}(\tilde{x}>\mu,{\sigma_0^2}') |
| precision was estimated from observations with sample variance (i.e. with sum of squared deviations , where deviations are from known mean ) | |
Normal-inverse gamma |
-
is the sample mean
| mean was estimated from observations with sample mean ; variance was estimated from observations with sample mean and sum of squared deviations | |
Normal-gamma |
-
is the sample mean
| mean was estimated from observations with sample mean , and precision was estimated from observations with sample mean and sum of squared deviations | |
-
is the sample mean
| mean was estimated from observations with total precision (sum of all individual precisions) and with sample mean | |
-
is the sample mean
| mean was estimated from observations with total precision (sum of all individual precisions) and with sample mean | \mathcal{N}\left(\tilde{\mathbf{x}}\mid{\boldsymbol\mu_0}', >\boldsymbol\mu,\frac{1}{\nu'-p+1}\boldsymbol\Psi'\right) |
| covariance matrix was estimated from observations with sum of pairwise deviation products | |
-
is the sample mean
-
| mean was estimated from observations with sample mean ; covariance matrix was estimated from observations with sample mean and with sum of pairwise deviation products | t_>{\boldsymbol\mu_0}',\frac{\kappa_0+n} ,\, \kappa_0+n,\, \nu_0+n ,\,
-
is the sample mean
-
| mean was estimated from observations with sample mean ; covariance matrix was estimated from observations with sample mean and with sum of pairwise deviation products | | observations with sum of the order of magnitude of each observation (i.e. the logarithm of the ratio of each observation to the minimum ) | |
| observations with sum of the β'th power of each observation | |
Log-normal | Same as for the normal distribution after applying the natural logarithm to the data for the posterior hyperparameters. Please refer to to see the details. |
| observations that sum to | (Lomax distribution) |
| observations with sum | \operatorname{CG}(\tilde{\mathbf{x}}\mid\alpha,{\alpha_0}',{\beta_0}')=\operatorname{\beta'}(\tilde{\mathbf{x}}>\alpha,{\alpha_0}',1,{\beta_0}') |
| observations with sum | |
α (shape) | | | or observations ( for estimating , for estimating ) with product | |
| was estimated from observations with product ; was estimated from observations with sum | |
| and were estimated from observations with product and product of the complements | |
See also
-
Beta-binomial distribution
Notes